import sys
from cx_Freeze import setup, Executable
import os

# 确保图标存在
if not os.path.exists('file_transfer.ico'):
    try:
        from create_icon import create_icon
        create_icon()
    except:
        print("Warning: Could not create icon file")

# 定义要包含的文件
include_files = [
    ('file_transfer.ico', 'file_transfer.ico'),  # (源文件, 目标文件)
]

base = None
if sys.platform == "win32":
    base = "Win32GUI"

setup(
    name="FileTransfer",
    version="1.0",
    description="局域网文件传输工具",
    options={
        'build_exe': {
            'include_files': include_files,
        }
    },
    executables=[
        Executable(
            "file_transfer_app.py",
            base=base,
            icon="file_transfer.ico",
            uac_admin=True  # 请求管理员权限
        )
    ]
) 